package com.vcit.system.service.clazz.impl;

import java.util.ArrayList;
import java.util.List;

import com.vcit.common.core.domain.entity.SysUser;
import com.vcit.common.utils.DateUtils;
import com.vcit.common.utils.SecurityUtils;
import com.vcit.common.utils.StringUtils;
import com.vcit.system.domain.clazz.TClazz;
import com.vcit.system.mapper.clazz.TClazzMapper;
import com.vcit.system.service.clazz.ITClazzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * 班级Service业务层处理
 *
 * @author dff
 * @date 2025-01-17
 */
@Service
public class TClazzServiceImpl implements ITClazzService
{
    @Autowired
    private TClazzMapper tClazzMapper;

    /**
     * 查询班级
     *
     * @param id 班级主键
     * @return 班级
     */
    @Override
    public TClazz selectTClazzById(Long id)
    {
        return tClazzMapper.selectTClazzById(id);
    }

    /**
     * 查询班级列表
     *
     * @param tClazz 班级
     * @return 班级
     */
    @Override
    public List<TClazz> selectTClazzList(TClazz tClazz)
    {
        return tClazzMapper.selectTClazzList(tClazz);
    }

    /**
     * 新增班级
     *
     * @param tClazz 班级
     * @return 结果
     */
    @Override
    public int insertTClazz(TClazz tClazz)
    {
        tClazz.setCreateBy(SecurityUtils.getUsername());
        tClazz.setCreateTime(DateUtils.getNowDate());
        return tClazzMapper.insertTClazz(tClazz);
    }

    /**
     * 修改班级
     *
     * @param tClazz 班级
     * @return 结果
     */
    @Override
    public int updateTClazz(TClazz tClazz)
    {
        tClazz.setUpdateBy(SecurityUtils.getUsername());
        tClazz.setUpdateTime(DateUtils.getNowDate());
        return tClazzMapper.updateTClazz(tClazz);
    }

    /**
     * 批量删除班级
     *
     * @param ids 需要删除的班级主键
     * @return 结果
     */
    @Override
    public int deleteTClazzByIds(Long[] ids)
    {
        return tClazzMapper.deleteTClazzByIds(ids);
    }

    /**
     * 删除班级信息
     *
     * @param id 班级主键
     * @return 结果
     */
    @Override
    public int deleteTClazzById(Long id)
    {
        return tClazzMapper.deleteTClazzById(id);
    }
}